#ifndef GAME_OBJECT_H
#define GAME_OBJECT_H

#include "../tools/Point.h"
#include <pthread.h>

class GameObject
{
	static unsigned long next_id;
	
protected:
	lVec3D game_position;
	
	// So Draw doesn't try to draw in the middle of an update and Game doesn't try to update while drawing
	pthread_mutex_t lock;
	
	unsigned long time_since_last_update;		// The time since this unit was last updated (helps Draw interpolate)
	
	virtual void update(unsigned long dt) = 0;
	
public:
	static unsigned long get_next_id() { return next_id ++; }	// TODO Is thread safety required?
	
	unsigned long id;
	
	GameObject();
	
	virtual ~GameObject() { }
};

#endif
